<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<%@ include file="../common/_new_head.jsp" %>
<!--修改id弹出层 -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="exampleModalLabel">变更战网ID</h4>
            </div>
            <form action="/changeSelf">
                <div class="modal-body">
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">新战网ID:</label>
                        <input type="text" class="form-control" name = "signName" id="recipient-name">
                    </div>
                    注：战网ID每个月只能修改一次，首次免费，此后每次消耗10点积分，请珍惜机会。
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary">确定</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--变更id弹出层-->

<!--创建比赛弹出层 -->
<div class="modal fade" id="createMatch" tabindex="-1" role="dialog" aria-labelledby="createMatchLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="createMatchLabel">创建比赛</h4>
            </div>
            <form action="/match/createMatch">
                <div class="modal-body">
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">比赛名称:</label>
                        <input type="text" class="form-control" name = "Match.name">
                        <label for="recipient-name" class="control-label">报名开始时间:</label>
                        <input type="text" class="form-control" name = "Match.signUpTime">
                        <label for="recipient-name" class="control-label">报名结束时间:</label>
                        <input type="text" class="form-control" name = "Match.closingTime">
                        <label for="recipient-name" class="control-label">比赛人数:</label>
                        <input type="number" class="form-control" name = "Match.playerNum">
                        <label for="recipient-name" class="control-label">赛制(目前只支持单败):</label>
                        <input type="text" class="form-control" name = "Match.type">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary">确定</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--创建比赛弹出层-->

    <div class="content-wrapper">
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-md-6">
                    <!-- Horizontal Form -->
                    <div class="box box-info">
                        <div class="box-header with-border">
                            <h3 class="box-title">个人信息</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <table class="table">
                                <tr>
                                    <td>邮箱</td><td>${user.name}</td>
                                </tr>
                                <tr>
                                    <td>战网</td><td>${user.signName}</td>
                                    <td><button type="button" class="btn btn-block btn-success btn-xs" data-toggle="modal" data-target="#exampleModal">变更申请</button></td>
                                </tr>
                                <tr>
                                    <td>注册时间</td><td>${user.create_time}</td>
                                </tr>
                                <tr>
                                    <td>变更时间</td><td>${user.modify_time}</td>
                                </tr>
                            </table>
                        </div>
                        <!-- /.box-body -->

                    </div>
                    <!-- /.box -->
                </div>

                <!--/.col (right) -->
                <div class="col-md-6">
                    <!-- Horizontal Form -->
                    <div class="box box-success">
                        <div class="box-header with-border">
                            <h3 class="box-title">战斗力</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <dl class="dl-horizontal">
                                <dt>胜场</dt>
                                <dd>...</dd>
                                <dt>负场</dt>
                                <dd>...</dd>
                                <dt>胜率</dt>
                                <dd>...</dd>
                                <dt>比赛积分</dt>
                                <dd>${user.score}</dd>
                                <dt>可用积分</dt>
                                <dd>${user.points}</dd>
                            </dl>
                        </div>
                        <!-- /.box-body -->

                    </div>
                    <!-- /.box -->
                </div>
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-md-12">
                    <!-- Horizontal Form -->
                    <div class="box box-warning">
                        <div class="box-header with-border">
                            <h3 class="box-title">近期动态</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <ul class="timeline">
                                <li class="time-label">
                                  <span class="bg-red">
                                    2015-08-25
                                  </span>
                                </li>
                                <li>
                                    <i class="fa fa-user bg-aqua"></i>
                                    <div class="timeline-item">
                                        <span class="time"><i class="fa fa-clock-o"></i> 5分钟前</span>
                                        <h3 class="timeline-header no-border"><a href="#">Kugong</a> 第二轮获胜。</h3>
                                    </div>
                                </li>
                                <li>
                                    <i class="fa fa-user bg-aqua"></i>
                                    <div class="timeline-item">
                                        <span class="time"><i class="fa fa-clock-o"></i> 25分钟前</span>
                                        <h3 class="timeline-header no-border"><a href="#">Kugong</a> 第一轮获胜。</h3>
                                    </div>
                                </li>
                                <li class="time-label">
                                  <span class="bg-green">
                                    2015-08-24
                                  </span>
                                </li>
                                <li>
                                    <i class="fa fa-user bg-aqua"></i>
                                    <div class="timeline-item">
                                        <span class="time"><i class="fa fa-clock-o"></i> 1天前</span>
                                        <h3 class="timeline-header no-border"><a href="#">Kugong</a> 报名安萌对抗赛第四周周赛。</h3>
                                    </div>
                                </li>

                                <li>
                                    <i class="fa fa-clock-o bg-gray"></i>
                                </li>

                            </ul>
                        </div>
                        <!-- /.box-body -->

                    </div>
                    <!-- /.box -->
                </div>

            </div>
            <c:if test="${ sessionScope.level>'1'}">
            <!-- /.row -->
            <div class="row">
                <div class="col-md-12">
                    <!-- Horizontal Form -->
                    <div class="box box-warning">
                        <div class="box-header with-border">
                            <h3 class="box-title">管理员</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <button type="button" class="btn btn-block btn-success btn-xs" data-toggle="modal" data-target="#createMatch">创建比赛</button>
                        </div>
                        <!-- /.box-body -->

                    </div>
                    <!-- /.box -->
                </div>

            </div>
            </c:if>
        </section>
        <!-- /.content -->
    </div>
    <%@ include file="../common/_new_foot.jsp" %>
<script type="text/javascript">

    $('#exampleModal').on('show.bs.modal', function (event) {
        var button = $(event.relatedTarget);
        var recipient = button.data('whatever');
        var modal = $(this);
        modal.find('#battle_id').val(recipient);
    })
</script>
</html>